import { defineComponent } from "vue";
import style from "./index.module.less";
import { Sidebar, SidebarItem } from "vant";
import { sidebarProps } from "./types";
import "./index.less";
export default defineComponent({
  name: "",
  props: sidebarProps,
  emits:['change'],
  setup(_,{emit}) {
    return () => {
      return (
        <Sidebar class="sidebar" v-model={_.value}>
          {_.data.map((e) => {
            return <SidebarItem title={e.name} onClick={()=>emit("change",e.value)}></SidebarItem>;
          })}
        </Sidebar>
      );
    };
  },
});
